<template>
  <view class="content">
    <uv-sticky :offsetTop="0" :customNavHeight="0" bgColor="#fff">
      <view class="tas">
        <uv-tabs :scrollable="false" @change="tabListChange" :current="tabCurrent" :lineColor="themConfig.theme.color"
                 :list="tabList"></uv-tabs>
      </view>
    </uv-sticky>
    <view class="items">
      <uv-gap height="10"/>
      <view class="item-list" v-for="(item, idx) in groupInfos">
        <SchoolGroup :properties="groupComponentProperties" :datas="[item]">
          <template v-slot:title>
            <view></view>
          </template>
          <template v-slot:bottom>
            <view class="btn-operate">
              <view>
                <uv-text size="13" color="#606266" :text="'最小成团数量：'+item.goods.minNumber"></uv-text>
                <uv-text size="13" color="#606266"  :text="'最大成团数量：'+item.goods.maxNumber"></uv-text>
              </view>
              <view style="display: flex">
                <view v-if="item.state==0" class="btn-view">
                  <uv-button type="error" @click="confirmAbort('1',item)" text="结束拼团"></uv-button>
                </view>
                <view class="btn-view"><uv-button @click="toDetail(item)" type="primary" text="查看详情"></uv-button></view>
              </view>
            </view>
          </template>
        </SchoolGroup>
      </view>

      <Empty :show="groupInfos.length<=0"/>

      <uv-load-more v-if="isReachBottom" @loadmore="loadmore" :status="loading.status" :loading-text="loading.loadingText"
                    :loadmore-text="loading.loadmoreText"
                    nomore-text=" "/>
      <uv-gap height="10" v-if="isReachBottom" bgColor=""></uv-gap>
    </view>

    <!--    终止拼团弹出框-->
    <uv-modal ref="modal"
              :confirmColor="themConfig.theme.color"
              :title="abortItem.activityName" showCancelButton :closeOnClickOverlay="false" content='' @confirm="confirmAbort('2',null)">
      <view class="slot-content" >
        <li>已成团数量：{{abortItem.goods.saleNum}}</li>
        <li>最小成团数量：{{abortItem.goods.minNumber}}</li>
        <li>最大成团数量：{{abortItem.goods.maxNumber}}</li>
        <br/>
        <p>终止活动后会根据创建团活动时候设置的属性【是否自动成团】【成团后是否自定接单完成】结束团活动</p>
        <p>如果已达最低成团数量，订单不会取消</p>

      </view>
    </uv-modal>

<!--    <FloatingBackHome/>-->

    <!--#ifdef H5-->
    <FloatingBtn @clickBtn="clickBtn" :size="35" :position="{ right: '25px', bottom: '100px' }" :iconColor="themConfig.theme.color"
                 jumpath="" icon="plus" background="white" boxShadow="none"/>
    <!--#endif-->
    <!-- #ifndef H5-->
    <view @click="clickBtn">
      <FloatingBtn :size="35" :position="{ right: '25px', bottom: '100px' }" :iconColor="themConfig.theme.color"
                   jumpath="" icon="plus" background="white" boxShadow="none"/>
    </view>
    <!--#endif-->
  </view>
</template>

<script>

import {mixins} from './index.js'
import uvCountDown from '../../../components/school/group/uv-count-down.vue'

export default {
  components: {uvCountDown},
  mixins: [mixins]
}
</script>
<style scoped lang="scss">
@import './index.scss';

</style>
